﻿using System;
using YaAppoint.Departments;
using YaAppoint.Devices;
using YaAppoint.DeviceTypes;

namespace YaAppoint.Rules
{
    public class RuleDto
    {
        public Guid Id { get; set; }

        public RuleLevel Level { get; set; }

        public LogicType LogicType { get; set; } = LogicType.Required;

        /// <summary>
        /// 名称
        /// </summary>
        public virtual string Name { get; set; }

        /// <summary>
        /// C#类型名(带完整的命名空间路径)
        /// </summary>
        public virtual string TypeName { get; set; }

        /// <summary>
        /// 脚本内容
        /// C#代码
        /// </summary>
        public virtual string? Script { get; set; }

        /// <summary>
        /// Json
        /// 条件表达式，基于“Vue Query Builder”组件生成的条件组合json
        /// </summary>
        public virtual string? Expression { get; set; }

        /// <summary>
        /// 规则组ID
        /// </summary>
        public virtual Guid? RuleGroupId { get; set; }

        /// <summary>
        /// 规则组
        /// </summary>
        public virtual RuleGroupDto? RuleGroup { get; set; }

        // 描述
        public virtual string? Description { get; set; }

        /// <summary>
        /// 优先级
        /// </summary>
        public virtual int Order { get; set; } = 0;

        /// <summary>
        /// 活动
        /// </summary>
        public virtual bool IsActive { get; set; } = true;

        /// <summary>
        /// 科室ID
        /// </summary>
        public virtual Guid? DepartmentId { get; set; }

        /// <summary>
        /// 科室
        /// </summary>
        public virtual DepartmentDto? Department { get; set; }

        /// <summary>
        /// 设备类型ID
        /// </summary>
        public virtual Guid? DeviceTypeId { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public virtual DeviceTypeDto? DeviceType { get; set; }

        /// <summary>
        /// 设备ID
        /// </summary>
        public virtual Guid? DeviceId { get; set; }

        /// <summary>
        /// 设备
        /// </summary>
        public virtual DeviceDto? Device { get; set; }
    }
}
